﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using System.Data.SqlClient;
using ECONTACT.Controller;

namespace ECONTACT
{
    public partial class frmPhanLop : Form
    {
        LopCtrl m_LopCtrl = new LopCtrl();
        HocSinhCtrl m_HocSinhCtrl = new HocSinhCtrl();
        PhanLopCtrl m_PhanLopCtrl = new PhanLopCtrl();

        public frmPhanLop()
        {
            InitializeComponent();
            DataService.OpenConnection();
        }

        private void frmPhanLop_Load(object sender, EventArgs e)
        {
            m_LopCtrl.HienThiComboBoxTen(cmbMaLop);
            m_HocSinhCtrl.HienThiComboBox(cmbMaHS);
            m_PhanLopCtrl.HienThi(dGVPhanLop, cmbMaLop, cmbMaHS);
        }

        private void btnThem_Click(object sender, EventArgs e)
        {
            m_PhanLopCtrl.LuuPhanLop(cmbMaLop.SelectedValue.ToString(), cmbMaHS.SelectedValue.ToString());
            m_PhanLopCtrl.HienThi(dGVPhanLop, cmbMaLop, cmbMaHS);
        }
    }
}
